<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>登录占比</title>
<@fm.header />
<script type="text/javascript" src="/resources/js/easyui/jquery.edatagrid.js"></script>
	<script>

        $(function() {
            $('#tt').edatagrid({
                onLoadSuccess : function(data) {
                    $(".datagrid-header-check").html("");
                    if (data) {
                        $.each(data.rows, function(index, item) {
                            if (item.isFilter == 1) {
                                $('#tt').datagrid('checkRow', index);
                            }
                        });
                    }
                },
                onCheck : function(index,row){
                    $.ajax({
                        url : '/apkFilter/saveApk?filterId='+$('#filterId').val(),
                        data : row,
                        type : 'POST'
                    });
                },
                onUncheck : function(index,row){
                    $.ajax({
                        url : '/apkFilter/delApk?filterId='+$('#filterId').val(),
                        data : row,
                        type : 'POST'
                    });
                }
            })
        });
        	function doSearch() {
				$('#tt').datagrid('load', {
					filterId: $('#filterId').val(),
					apkName: $('#apkName').val()
				});
			}
	</script>
<style>
.provinceClass label {
	font-size: 12px;
	float:left;
	margin:2px;
	width:80px;
	height:20px;
}
</style>
</head>
<body>
<div class="easyui-layout" style="text-align: center; height: 400px;" fit="true">
	
	<div id="tb" style="padding:3px">
        <span>关键字</span>
        <input id="apkName" class="easyui-textbox" style="width: 155px;" name="apkName"/>
        <a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch();">查询</a>
        <input type="hidden" id="filterId" name="filterId" value=${filterId}>
    </div>

	<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
	    <input type="hidden" id="markId" value=${mark}>
		 <table id="tt" class="easyui-datagrid" title="选择apk" iconCls="icon-save" toolbar="#tb" rownumbers="true" idField="apkId"
			url="/apkFilter/${filterId}/apkListConfig?json" singleSelect="false" checkOnSelect="false"  fitColumns="true" >
		    <thead>	
		    	<tr>	    
		    		<th align="center" width="10%" field="apkId" checkbox="true"></th>
		        	<th align="center" width="50%" field="apkName">名称</th>
		        </tr>
		    </thead>   
		</table>
	</div>
</div>
</body>
</html>